Publish Topic
To receive events for Salesforce changes associated with a topic, you must create the topic, if it does not exist. When you create a topic, the connector creates a PushTopic, which is a special object in Salesforce that binds a name (in this case, the topic’s name) and a Salesforce Object Query Language (SOQL) query together. After you create a topic, you can subscribe and publish topic by it name.
Prerequisites:
- Installing salesforce connector(by login into anypoint exchange from studio you can install the salesfoce conenctor)
- Salesforce developer account
- Security token
- Consumer key and secret(If you are using the Salesforce connector to access an OAuth API, you also need a consumer key and secret)
Create project in anypoint studio
Drag and drop Salesforce Publish Topic Operation from mule palette
Configure the connection details for salesforce and use the Basic Username and Password connection(Username,Password,Securitytoken),you can also use other connections as well to do the configuration like Oauth UserName and Password etc
Configure Topic name, Query
Deploy the appliction and test using listener
Topic is created in salesforce.
In next tutorial I will demonstrate how to subscribe the topic that has been created as part of this tutorial
Sample application: publishtopicinsalesforce sample